package com.gzdh.tang.ali.controller;

import com.gzdh.tang.ali.mapper.AliPubMapper;
import com.gzdh.tang.comm.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("api/v2/order")
public class AliOrderController {

    @Autowired
    AliPubMapper aliPubMapper;

    @GetMapping("getCensus")
    public Result<Object> getCensus(@RequestParam("deviceId") String deviceId) {
        Result<Object> result = new Result<>();
        result.setResult(aliPubMapper.getCensus(deviceId));
        return result;
    }

    @GetMapping("getOder")
    public Result<Object> getOrder(@RequestParam("deviceId") String deviceId) {
        Result<Object> result = new Result<>();
        result.setResult(aliPubMapper.getAliOrderDTO(deviceId));
        return result;
    }

}
